import { create } from 'zustand'

const initialToastVal = {
  isOpened: false,
  text: '',
  icon: ''
}

export const useToastStore = create<typeof initialToastVal>()(() => ({
  ...initialToastVal
}))

export const toast = (text, icon = '') => useToastStore.setState({ isOpened: true, text, icon })
export const hideToast = () => useToastStore.setState({ isOpened: false })

